package vip.xiaonuo.smzq.modular.lifecycle.service.entity.impl;

import  java.util.List;
import java.util.Map;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.transaction.annotation.Transactional;
import vip.xiaonuo.smzq.modular.lifecycle.entity.KclClsp;
import vip.xiaonuo.smzq.modular.lifecycle.mapper.entity.KclClspMapper;
import vip.xiaonuo.smzq.modular.lifecycle.service.entity.KclClspService;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * <p>
 * 储量审批流程 服务实现类
 * </p>
 *
 * @author 于彦飞
 * @since 2024-11-11
 */
@Service
public class KclClspServiceImpl extends ServiceImpl<KclClspMapper, KclClsp> implements KclClspService {
        @Autowired
        private KclClspMapper kclClspMapper;



        @Override
        public List<KclClsp>  queryKclClspList(KclClsp kclClsp){
            List<KclClsp> list = new LambdaQueryChainWrapper<KclClsp>(kclClspMapper).setEntity(kclClsp)
            .list();
//            DictConvertUtil.convertToDictionaryList(list,null);
            return list;
        }

        @Override
        public IPage<KclClsp> queryKclClspListPage(KclClsp kclClsp){
            IPage<KclClsp> iPage = new LambdaQueryChainWrapper<KclClsp>(kclClspMapper).setEntity(kclClsp)
            .page(new Page<>(kclClsp.getCurrentPageNum(),kclClsp.getPageSize()));

            List<KclClsp> records = iPage.getRecords();
//            DictConvertUtil.convertToDictionaryList(records,null);
            iPage.setRecords(records);
            return iPage;
        }


    @Override
    public boolean delKclClsp(String id){
        return this.removeById(id);
    }
    @Override
    public boolean delKclClspBatch(List<String> ids){
        return this.removeByIds(ids);
    }

}

